package de.baumann.browser.activitys.duobao

import android.content.Context
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.text.Html
import de.baumann.browser.R
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.iview.duobao.IWanFaGuiZeView
import de.baumann.browser.present.duobao.WanFaGuiZePresenter
import kotlinx.android.synthetic.main.activity_duo_bao_wan_fa_gui_ze.*
import kotlinx.android.synthetic.main.include_tool_bar_2.*

class DuoBaoWanFaGuiZeActivity : BaseOdinActivity<IWanFaGuiZeView, WanFaGuiZePresenter>(), IWanFaGuiZeView {

    companion object {
        fun startDuoBaoWanFaGuiZeActivity(context: Context) {
            context.startActivity(Intent(context, DuoBaoWanFaGuiZeActivity::class.java))
        }
    }

    override fun getLayout(): Int {
        return R.layout.activity_duo_bao_wan_fa_gui_ze
    }

    override fun getTitleText(): String {
        return "玩法规则"
    }

    override fun getBackIcon(): Int {
        return R.drawable.ic_back
    }

    override fun initView() {
        initToolbar(commToolBar, commTitle)
    }

    override fun initData() {
        presenter?.getwfgz()
    }

    override fun createPresenter(): WanFaGuiZePresenter {
        return WanFaGuiZePresenter()
    }

    override fun createView(): IWanFaGuiZeView {
        return this
    }

    override fun setHtml(html: String) {
        wfgz.text = Html.fromHtml(html)
    }
}